
import 'dart:convert';

import 'package:flutter_frame/generated/json/base/json_field.dart';
import 'package:flutter_frame/generated/json/user_data_entity.g.dart';

@JsonSerializable()
class UserDataEntity {

	UserDataEntity();

	factory UserDataEntity.fromJson(Map<String, dynamic> json) => $UserDataEntityFromJson(json);
	@JSONField(name: 'access_token')
	String? accessToken;
	@JSONField(name: 'token_type')
	String? tokenType;
	@JSONField(name: 'expires_in')
	int? expiresIn;
	@JSONField(name: 'scope')
	String? scope;
	@JSONField(name: 'systemUser')
	UserDataSystemUser? systemUser;
	@JSONField(name: 'jti')
	String? jti;

	Map<String, dynamic> toJson() => $UserDataEntityToJson(this);

	UserDataEntity copyWith({String? accessToken, String? tokenType, int? expiresIn, String? scope, UserDataSystemUser? systemUser, String? jti}) {
		return UserDataEntity()
			..accessToken= accessToken ?? this.accessToken
			..tokenType= tokenType ?? this.tokenType
			..expiresIn= expiresIn ?? this.expiresIn
			..scope= scope ?? this.scope
			..systemUser= systemUser ?? this.systemUser
			..jti= jti ?? this.jti;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class UserDataSystemUser {

	UserDataSystemUser();

	factory UserDataSystemUser.fromJson(Map<String, dynamic> json) => $UserDataSystemUserFromJson(json);
	String? id;
	String? username;
	String? nickname;
	String? otherUid;
	String? password;
	String? email;
	String? mobile;
	int? status;
	dynamic createTime;
	dynamic modifyTime;
	String? lastLoginTime;
	String? sex;
	String? avatar;
	int? isSystem;
	String? description;
	int? type;
	String? sign;
	dynamic createDate;
	dynamic updateDate;
	dynamic createBy;
	dynamic updateBy;
	String? departmentId;
	int? isViewAll;
	String? companyCode;
	dynamic areaCode;
	String? roleId;
	String? roleName;

	Map<String, dynamic> toJson() => $UserDataSystemUserToJson(this);

	UserDataSystemUser copyWith({String? id, String? username, String? nickname, String? otherUid, String? password, String? email, String? mobile, int? status, dynamic createTime, dynamic modifyTime, String? lastLoginTime, String? sex, String? avatar, int? isSystem, String? description, int? type, String? sign, dynamic createDate, dynamic updateDate, dynamic createBy, dynamic updateBy, String? departmentId, int? isViewAll, String? companyCode, dynamic areaCode, String? roleId, String? roleName}) {
		return UserDataSystemUser()
			..id= id ?? this.id
			..username= username ?? this.username
			..nickname= nickname ?? this.nickname
			..otherUid= otherUid ?? this.otherUid
			..password= password ?? this.password
			..email= email ?? this.email
			..mobile= mobile ?? this.mobile
			..status= status ?? this.status
			..createTime= createTime ?? this.createTime
			..modifyTime= modifyTime ?? this.modifyTime
			..lastLoginTime= lastLoginTime ?? this.lastLoginTime
			..sex= sex ?? this.sex
			..avatar= avatar ?? this.avatar
			..isSystem= isSystem ?? this.isSystem
			..description= description ?? this.description
			..type= type ?? this.type
			..sign= sign ?? this.sign
			..createDate= createDate ?? this.createDate
			..updateDate= updateDate ?? this.updateDate
			..createBy= createBy ?? this.createBy
			..updateBy= updateBy ?? this.updateBy
			..departmentId= departmentId ?? this.departmentId
			..isViewAll= isViewAll ?? this.isViewAll
			..companyCode= companyCode ?? this.companyCode
			..areaCode= areaCode ?? this.areaCode
			..roleId= roleId ?? this.roleId
			..roleName= roleName ?? this.roleName;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}